<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Classificados</title>
</head>
<body>

	<f:view>

		<h2>Classificados Geral</h2>

		<h:dataTable border="1" value="#{principal.listaAnunciosGeral}" var="anuncio">
			<h:column id="column1">
				<f:facet name="header">
					<h:outputText value="Identificador"></h:outputText>
				</f:facet>
				<h:outputText value="#{anuncio.id}"></h:outputText>
			</h:column>		
			<h:column id="column2">
				<f:facet name="header">
					<h:outputText value="Resumo"></h:outputText>
				</f:facet>
				<h:outputText value="#{anuncio.resumo}"></h:outputText>
			</h:column>
			<h:column id="column3">
				<f:facet name="header">
					<h:outputText value="Valor"></h:outputText>
				</f:facet>
				<h:outputText value="#{anuncio.valor}"></h:outputText>
			</h:column>
			<h:column id="column4">
				<f:facet name="header">
					<h:outputText value="Detalhes"></h:outputText>
				</f:facet>
				<h:form>
					<h:commandLink action="mostrarAnuncio">
						<h:outputText value="(+)"></h:outputText>
						<f:setPropertyActionListener value="#{anuncio}" target="#{principal.anuncio}"/>
					</h:commandLink>
				</h:form>
			</h:column>			
		</h:dataTable>
		<br/>
		<h:form>
			<h:commandLink action="efetuarLogin">
				<h:outputText value="Efetuar Login"></h:outputText>
			</h:commandLink>
		</h:form>
		
	</f:view>

</body>
</html>